home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / prtrep51.zip / REPSRC.ZIP / REPDEM02.PAS < prev    next >
Pascal/Delphi Source File  |  1996-06-24  |  2KB  |  71 lines

  1. unit Repdem02;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   StdCtrls, Forms, DBCtrls, DB, DBGrids, Buttons, DBTables, Grids,
  8.   ExtCtrls, Printers, PrnGridR, CB_Types, PrnFile;
  9.  
  10. type
  11.   Tdem02form = class(TForm)
  12.     DBGrid1: TDBGrid;
  13.     Panel1: TPanel;
  14.     DataSource1: TDataSource;
  15.     Panel2: TPanel;
  16.     Query1: TQuery;
  17.     Query1CustNo: TFloatField;
  18.     Query1Company: TStringField;
  19.     Query1Country: TStringField;
  20.     Query1Phone: TStringField;
  21.     Query1Contact: TStringField;
  22.     Previews: TBitBtn;
  23.     Exit: TBitBtn;
  24.     Preview: TBitBtn;
  25.     Query1LastInvoiceDate: TDateTimeField;
  26.     PrintGridReport1: TPrintGridReport;
  27.     Memo1: TMemo;
  28.     procedure FormCreate(Sender: TObject);
  29.     procedure PreviewClick(Sender: TObject);
  30.     procedure PreviewsClick(Sender: TObject);
  31.     procedure ExitClick(Sender: TObject);
  32.   private
  33.     { private declarations }
  34.   public
  35.   end;
  36.  
  37. var
  38.   dem02form: Tdem02form;
  39.  
  40. implementation
  41.  
  42. {$R *.DFM}
  43.  
  44. procedure Tdem02form.FormCreate(Sender: TObject);
  45. begin
  46.   Query1.Open;
  47.   PrintGridReport1.Orientation := Portrait;
  48.  
  49.   { When printing subtotals - Use field COUNTRY }
  50.   PrintGridReport1.SetSubTotalField(1, 'COUNTRY');
  51. end;
  52.  
  53. procedure Tdem02form.PreviewClick(Sender: TObject);
  54. begin
  55.     PrintGridReport1.PrintSubTotals := False;
  56.     PrintGridReport1.Execute;
  57. end;
  58.  
  59. procedure Tdem02form.PreviewsClick(Sender: TObject);
  60. begin
  61.     PrintGridReport1.PrintSubTotals := True;
  62.     PrintGridReport1.Execute;
  63. end;
  64.  
  65. procedure Tdem02form.ExitClick(Sender: TObject);
  66. begin
  67.     Close;
  68. end;
  69.  
  70. end.
  71.